home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-06-20 | 121.5 KB | 4,260 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C Spot Run
-
- A User-Supported C Add-on Library
-
- IBM PC Reference Manual
-
- Version 1.0
-
- May 5, 1986
-
-
- Bob Pritchett
- New Dimension Software
-
- 23 Pawtucket Dr.
- Cherry Hill, NJ 08003
-
-
- Copyright 1986 Bob Pritchett
- All Rights Reserved C Spot Run - Documentation
-
-
-
- Table of Contents
-
- 1. Introduction............................................. 3
- 1.1. What is C Spot Run?................................. 3
- 1.2. Why C Spot Run?..................................... 3
-
- 2. Obtaining and Copying C Spot Run......................... 4
- 2.1. User Supported Software............................. 4
- 2.2. Ownership of C Spot Run............................. 4
- 2.3. Contents of C Spot Run.............................. 4
- 2.4. License for C Spot Run.............................. 4
-
- 3. Using the C Spot Run Library............................. 6
- 3.1. Using the Library with Your Compiler................ 6
- 3.2. Modifying the Library............................... 6
- 3.2.1. Problem Areas................................ 6
- 3.2.2. Helpful Suggestions.......................... 6
- 3.3. Using the Utilities and Aids........................ 7
-
- 4. Format of Routine/Utility Descriptions................... 8
- 4.1. How to Use Routine Description Pages................ 8
- 4.2. How to Use Utility Decription Pages................. 8
-
- 5. The Library Routine Descriptions.........................
- 5.1. General Descriptions of Related Routines............
- 5.2. Individual Routine Descriptions.....................
-
- 6. Utility and Aid Descriptions.............................
-
- 7. Header File Descriptions.................................
-
- 8. Appendix A - Updating the Library........................
-
- 9. Appendix B - Contacting Authors..........................
-
- 10. Appendix C - Submitting Routines or Utilities............
-
- 11. Routine/Utility Submission Form..........................
-
- 12. User Response Form....................................... C Spot Run - Documentation
-
-
- 1. Introduction
-
- 1.1. What is C Spot Run?
-
- C Spot Run is a library of C and Assembly routines for C
- programmers. These routines supplement the standard libraries
- provided with compilers, and provide tools for specialized
- applications.
- All routines in this library are in the public domain, and
- the accompanying utilities and programming aids are either public
- domain or are part of the user supported software world.
- Our goal is to provide low cost (free!) routines and
- utilities for C programmers. The use of pre-written routines
- reduces the amount of tedious code writing.
-
- 1.2. Why C Spot Run?
-
- What is probably the next question to cross your mind is
- simply, why? Good question, and I hope this is a good answer.
- Because. Because there are so many libraries similar to this
- one. Because they all cost money, and this one doesn't. Because
- as of yet there is no central distribution point for much of the
- C routines floating around in .C files everywhere. We think that
- C Spot Run is filling a need, and hope you agree with us. In
- addition, we would appreciate any correspondance, whether
- positive or negative, and especially contributions to our
- collection. C Spot Run - Documentation
-
-
- 2. Obtaining and Copying C Spot Run
-
- 2.1. User Supported Software
-
- User supported software is software distributed at no cost
- with the expectation that those who find useful will send a
- donation to support the development. In most cases those who
- contribute become registered users and receive automatic updates,
- printed manuals, and/or source code.
-
- 2.2. Ownership of C Spot Run
-
- Without a major essay on copyright laws, the routines and
- utilities in this package are the property of the author, with
- the exception of those released to the Public Domain. (PD) It is
- important to recognize the difference between Public Domain and
- user-supported software. (User-supported includes "Share-Ware",
- "Free-Ware" and several other names.) Unlike authors who totaly
- give their software to the public domain, some authors distribute
- their code with a limited license, usually something to the
- effect that you are not to distribute modified versions or charge
- for the distribution.
- The routines and utilities in this library are either
- totally public domain or have been released to this library for
- distribution as described in Appendix C of this document.
- As to the library itself, and this documentation, they are
- property of Bob Pritchett, and released under the limited license
- in section 2.4.
-
- 2.3. Contents of C Spot Run
-
- The very basic principle behind this library is user-
- supported software. In addition to monetary contributions, an
- even more valuable form is that of routines or utilities. Most
- of the routines and utilities in this library were written by two
- or three people, or are modifications of other routines in the
- public domain.
- We would like to build a sizable library of tools and helps
- for C programmers, and whether it is a new routine you wrote, or
- one that is already in the public domain world, your contribution
- of code and permission to let us use it would be appreciated.
- At present this library is a collection of routines and
- programming aids only. As this is the first release we have no
- idea how it will be received and how successful, or unsuccessful,
- it will be. Being as there are many other organizations that
- maintain large collections of programs in C, such as the C User's
- Group, this library will focus on routines and utilities.
-
- 2.4. Distribution License for C Spot Run
-
- The C Spot Run library of routines and utilities may be
- freely duplicated and distributed under the following terms.
-
- No fee may be charged other then reasonable expenses for
- media and reproduction, no more then six dollars. The routines, C Spot Run - Documentation
-
-
- utilities, and documentation are not to be distributed in
- modified form. All modifications and/or suggestions should be
- sent to the author at the address listed at the beginning of this
- document. The routines and utilities are not to be used in
- commercial applications or business environments without the
- express permission of the authors. Credit must be given to
- authors whose routines are used in any distributed application,
- unless other arrangements are made directly with the author. C Spot Run - Documentation
-
-
- 3. Using the C Spot Run Library
-
- 3.1. Using the Library with Your Compiler
-
- All utilities included in this library work with straight
- ASCII text files, unless otherwise specified, and those dealing
- with the syntax of the C language should work with all flavors of
- C that conform to the basic guidelines in K&R.
- The routines are distributed in several forms, usually
- either object code or source code, C or assembly. Specific
- information on each routine and it's compiler dependancies is
- available in the section entitled Compiler Specifics in each
- routine entry. As a general rule, object code and libraries are
- in the Microsoft/Lattice format. These libraries and object code
- modules can be linked to your program with LINK. If the source
- code is available simply check it for compiler differences (see
- the next section) and compile it with whatever compiler you use.
-
- 3.2. Modifying the Library
-
- Although many compilers use the same routines, they often
- are named differently, or use a different set of parameters.
- This section should be of assistance in modifying source to work
- with your, or someone else's, compiler. If you have some
- information that could be helpful in ocmpiler conversions, please
- contact us.
-
- 3.2.1. Problem Areas
-
- Some of the more common differences in compiler libraries
- are the naming conventions used. For instance, the routines to
- perform a DOS interrupt vary from intdos() to doint(), and have
- just as many differences in parameters. Some common differences
- are in string manipulation, hardware specific functions, and
- memory management. Here is some information that should be of
- help:
-
- 3.2.2. Helpful Suggestions
-
- Those with Microsoft C V3.0 should consult the header file
- V2TOV3.H for assistance, and Appendix D of the User's Guide,
- Converting from Previous Versions of the Compiler.
-
- Microsoft V3.0 uses unions declared in DOS.H as parameters
- for it's hardware/DOS functions unlike most other compilers which
- need the register variables etc. declared by the user. The
- register variables are stored in a union of type REGS, and are
- addressed using the union member x to access registers with x as
- a second character, or h to access the registers ending in h or
- l. Example: union REGS in; n = in.x.ax; y = in.h.bl;
-
- Microsoft's hardware interrupt is int86(int,&in,&out), cor-
- responding to sysint(int,&in,&out) used by many other compilers.
- Likewise intdos(&in,&out) corresponds to sysint(0x21,&in,&out). C Spot Run - Documentation
-
-
- Lattice/Computer Innovation's movmem(source, destination,
- width) corresponds to Microsoft's movedata(destination, source,
- width).
-
- All of Microsoft's string manipulation functions are in the
- format strxxx() or strnxxx(). Example: strlwr(string)
- strcat(string1, string2) strncat(string1, string2, number).
-
- 3.3. Using the Utilities and Aids
-
- The use of utilities and programming aids should be clearly
- described on their description pages. All include files should
- be included at the beginning of sources that need them, and in
- addition to the description page most independant utilities will
- provide a short summary of their use when run with no command
- line parameters. C Spot Run - Documentation
-
-
- 4. Format of Routine/Utility Descriptions
-
- 4.1. How to Use the Routine Description Pages
-
- The routine description pages are set up in such a manner
- that updates to the library will not require a totally new
- manual.
- Each routine has it's own full page regardless of how small
- or large it is. The page is set up in a special order, with the
- name of the routine on the upper right of the page at the top for
- quick indexing, followed by a short summary of the necessary
- arguments and their data types. Next is a line containing the
- creation and last update dates, and then the author's name and
- whether the source is in C or Assembly. Following these is a
- list of the files in which the code is contained, a list of other
- required functions that may not be in every library, and then a
- paragraph description of the function. This is followed with a
- paragraph explaining any ties to one specific compiler, the
- return value, a list of related functions in the library, and a
- final example of how it might be used in a portion of code.
- It is recommended that you keep the complete manual in a
- three ring binder, and as you receive updates simply print out
- the enclosed page, and insert it in alphabetical order among the
- function description pages. (This manual may seem like a waste
- of paper, but this way it saves a lot in the long run.)
-
- 4.2. How to Use the Utility Description Pages
-
- The utility description pages are similar to the routine
- descriptions described above except for the layout of
- information. On the utility description pages the first item is,
- as with the routine descriptions, the utility name on the upper
- right hand corner. Next is a summary of the utility including
- the creation and last update dates, the author's name, the source
- language, and then a copy of the documentation, usually an exact
- duplicate of whatever documentation the author has sent.
- As mentioned, the method for updating these description
- pages is the same as above in section 4.1.
-
-
- Directory Management Routines
-
- With the two basic file search routines ffirst() and fnext()
- any number of directories may be generated, and when combined
- with the windowing routines any application can have a convenient
- system for directory viewing and file selection.
- The possibilities are endless, thus only a limited number of
- directory viewing routines have been provided, but we trust that
- they will help you design and implement whatever file management
- you require. The following are some hints and suggestions:
-
- Finding and storing all the file names before displaying
- them has the benefit of allowing scrolling to take place forwards
- and back, but the disadvantage of a slight delay while reading in
- the information. If scrolling is needed, try saving the names as
- they are read and displayed, and keep pointers allowing you to
- scroll back, but not forward until the new file names are read.
-
- If it is neccessary to divide the file name and extension
- two obvious alternatives are presented. Either write a routine
- to go through the string containing the name, looking for the dot
- separater, and split the string into two parts, or use the
- sscanf() function to read the two fields into separate strings.
-
- Whatever you do with the provided directory routines, we'd
- appreciate a copy of your routine for curiosities sake, and if
- possible, inclusion in a future version of the library.
-
-
- Printer Operation Routines
-
- The printer output routines included in this verson, 1.0, of
- the library are intended to provide only the basics for printer
- control. The routines provide for single character output,
- lputchar(), string output, lprint(), and formatted string output,
- lprintf().
-
- These routines all call DOS function number 5 which means
- that with the DOS MODE command etc. the output can be redirected
- or reformatted.
-
- Many libraries include an extensive set of routines to set
- different attributes, fonts, and styles on printers. However,
- since these routines are usually dependant on one printer make,
- and generaly do little more then output two or three characters
- it was thought best to provide only the generic lputchar()
- function. If you would like to provide a set of printer specific
- or independant routines to perform these functions, please
- contact us.
-
-
- Window Function Library
-
- The C Spot Run window function library is a library of
- routines that perform background/foreground windowing. What this
- means is that any window that is overlapped by another window,
- when addressed for output, will be moved to the front of the
- 'stack' and become the active window.
-
- The window library also contains a large number of support
- routines to make movement of and output to windows as easy as
- possible. There are routines that make pop-up menus, center
- text, draw boxes, and do much more. Full color support is
- available, and for speed all of the cursor and output functions
- are in assembly.
-
- All windowing functions are in the file COUTPUT.OBJ, and
- source is not distributed.
-
- For ease of calling, in general you will find that all
- window functions are preceeded by a w in the function name,
- (wopen(), wclose(), etc.) and in most cases the first argument is
- the window pointer.
-
- For more information, consult the detailed function
- descriptions.
-
- I would like to thank Philip A. Mongelluzo whose Windows For
- C package was of invaluable use to me in the development of this
- package, not to mention the time he spent answering my questions.
-
-
- border
- Summary:
-
- int border(color);
- int color; /* Color of Border */
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: BORDER.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function draws sets the screen border to the specified color
- using function 11 of the BIOS video interrupt.
-
- Works in text modes only.
-
- Compiler Specifics:
-
- Has Microsoft's assembly header, otherwise none.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
-
-
- Example:
-
- border(4); /* Red Border */
-
-
- box
- Summary:
-
- int box(x,y,x2,y2,type);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- int type; /* Style of Border */
-
- Created: 08/ /85 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: BOX.C BOX.OBJ
-
- Requires: gotoxy() putch()
-
- Description:
-
- The box function draws a graphic box using the upper left and
- lower right corner coordinates. The border style can be a
- combination of the double and single line characters of the IBM
- character set, or any other printable character used all the way
- around. The border is chosen with type. If type is equal to
- one, an all single line border is drawn. If it is two, a double
- horizontal line and single vertical line is used, if it is three
- it is an all double border, if it is four a single horizontal
- line and double vertical line are used. Any other value in type
- will cause the border to consist entirely of this character.
-
- Compiler Specifics:
-
- BOX.OBJ was compiled using MSC 3.0, but there are no compiler
- specifics involved other then putch(), the put character to
- console function.
-
- Return Value:
-
- Returns a one if successful, or a negative one if invalid
- coordinates are passed.
-
- See Also:
-
- cbox()
-
- Example:
-
- box(10,10,20,30,"*"); /* A box with a border of *'s */
-
-
- cbox
- Summary:
-
- int cbox(x,y,x2,y2,type);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- int type; /* Style of Border */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: putchci() gotoxy()
-
- Description:
-
- This function is functionaly the same as box() except that the
- box is drawn in the current color. It is primarily used as an
- internal routine in COUTPUT.OBJ. For independant use, use color()
- or wcolor() to set the color.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns a one if successful, a negative one if invalid
- coordinates are passed.
-
- See Also:
-
- color() wcolor() box()
-
- Example:
-
- #include <color.h> /* Just for the colors... */
-
- color(RED_F,WHT_B); /* Red on White */
-
- cbox(5,5,20,60,1); /* A box with a single line border */
-
-
- ccenter
- Summary:
-
- int ccenter(row,string,color);
- int row; /* Row to Center String on */
- char *string; /* String to Center on Screen */
- int color; /* Color to Print String in */
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CCENTER.C CENTER.OBJ
-
- Requires: gotoxy() ccputs()
-
- Description:
-
- This routine is functionaly the same as center() only that the
- line is displayed in the color specified.
-
- Compiler Specifics:
-
- CCENTER.OBJ was compiled with MSC 3.0, but there are no other
- compiler specifics involved.
-
- Return Value:
-
- Nothing is returned and there are no validity checks. Giving a
- string longer then 80 characters, or a line number less then zero
- or greater then 24 will produce an unknown result on screen,
- while it should return cleanly.
-
- See Also:
-
- center() putat() cputat()
-
- Example:
-
- #include <color.h>
-
- char *string;
- scanf("%s",string);
-
- ccenter(0,"This line is centered in color.",RED_F);
- ccenter(2,"This one is in magenta on black, as opposed to red.",MAG_F);
- ccenter(3,"And yet another line, this time in green.",GRN_F);
-
- ccenter(5,string,WHT_F+BLU_B);
-
-
- ccls
- Summary:
-
- #include <color.h> /* For color definitions only... */
-
- int ccls(color);
- int color; /* Color of Screen */
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: CCLS.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function clears the screen and sets all the attributes to
- the given color. The cursor is sent to the home position.
-
- Compiler Specifics:
-
- Has Microsoft's assembly header, otherwise none.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- cls()
-
- Example:
-
- #include <color.h>
-
- ccls(RED_F+BLU_B); /* Attributes are red on blue. */
-
-
- ccputs
- Summary:
-
- #include <color.h> /* Color definitions only */
-
- int ccputs(string,color);
- int string; /* String to Put */
- int color; /* Color of String */
-
- Created: 12/29/85 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CCPUTS.OBJ
-
- Requires: putchci()
-
- Description:
-
- This function puts the given string out to the current cursor
- position in the specified color, using putchci() to do BIOS
- output.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- putchci()
-
- Example:
-
- #include <color.h>
-
- ccputs("This string in red.\n",RED_F);
-
-
- center
- Summary:
-
- int center(row,string);
- int row; /* Row to Center String on */
- char *string; /* String to Center on Screen */
-
- Created: 09/ /85 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CENTER.C CENTER.OBJ
-
- Requires: gotoxy() prints()
-
- Description:
-
- This routine will simply center string on line row. An eighty
- column display is assumed, and the cursor is left at the end of
- the string.
-
- Compiler Specifics:
-
- CENTER.OBJ was compiled with MSC 3.0, but there are no other
- compiler specifics involved.
-
- Return Value:
-
- Nothing is returned and there are no validity checks. Giving a
- string longer then 80 characters, or a line number less then zero
- or greater then 24 will produce an unknown result on screen,
- while it should return cleanly.
-
- See Also:
-
- centerf() ccenter() putat() cputat()
-
- Example:
-
- #include <stdio.h>
-
- char *string;
- scanf("%s",string);
-
- center(0,"This line is centered. Centering has a slight");
- center(1,"disadvantage with constant text in that the computation is");
- center(2,"done at run-time, as opposed to using putat() with a");
- center(3,"precalculated center.");
-
- center(5,string);
-
-
- centerf
- Summary:
-
- int centerf(row,string[,arguments...]);
- int row; /* Row to Center String on */
- char *string; /* String to Center on Screen */
-
- Created: 04/13/86 Last Updated: 04/13/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CENTERF.OBJ
-
- Requires: gotoxy() prints()
-
- Description:
-
- This routine performs the exact same function as center() with
- the exception that the string may contain formatting controls
- which are proccessed according to the same rules as printf()
- before the string is centered. Up to 15 formatting arguments may
- be used per string.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing returned, nor are coordinates checked, but be careful to
- make sure the formatted string will be less then 80 characters
- long.
-
- See Also:
-
- center() ccenter() putat() cputat()
-
- Example:
-
- #include <stdio.h>
-
- char *string;
- printf("What is your name? ");
- scanf("%s",string);
-
- centerf(4,"The answer is: %04d",243);
- centerf(7,"Hello, %s, nice to meet you.",string);
-
-
- chline
- Summary:
-
- int chline(x,y,y2,type);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int y2; /* Lower Right Col */
- int type; /* Style of Border */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: putchci() gotoxy()
-
- Description:
-
- This function will draw a line at x,y to x,y2 using the
- character(s) specified in type. Type may be any one of the five
- types accepted by box(). Usually this function is used to draw
- lines inside boxes, as it will use the proper side characters,
- but by using an ASCII character in type an ordinary line of that
- character is drawn. The line is drawn in the current color, as
- specified by color().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns a one if successful, a negative one if invalid
- coordinates are passed.
-
- See Also:
-
- cvline() whline()
-
- Example:
-
- #include <color.h> /* Just for the colors... */
-
- color(RED_F,WHT_B); /* Red on White */
-
- cbox(5,5,20,60,1); /* A box with a single line border */
-
- chline(5,7,60,1); /* Draws a line across the box */
-
-
- cls
- Summary:
-
- int cls();
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: CLS.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function clears the screen and sends the cursor to the home
- position using the video BIOS interrupt.
-
- Compiler Specifics:
-
- Microsoft's assembly header information.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- ccls() wcls()
-
- Example:
-
- cls();
-
-
- color
- Summary:
-
- #include <color.h> /* For Color Definitions Only */
-
- int color(fore,back)
- int fore; /* Foreground Color */
- int back; /* Background Color */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine sets the colors to be used in all following
- operations involving color in the windows package, unless
- otherwise specified. The argumetns must be in two parts, fore
- and back colors, with bold, blink, etc added to either one,
- unlike other routines in which the colors are just added.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- The color is returned.
-
- See Also:
-
- wcolor()
-
- Example:
-
- #include <color.h>
-
- color(RED_F+BOLD,BLU_B); /* Bold Red on Blue. */
-
-
- current_page
- Summary:
-
- int current_page();
-
- Created: 02/22/86 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This function returns the current active video page.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0. Only specific is use of register
- structures of MSC and int86(). Usually needs a change like
- sysint() instead of int86(). Check section three of this manual.
-
- Return Value:
-
- Number of current video page is returned, 0-3 or 0-7, depending
- on monitor.
-
- See Also:
-
- set_page()
-
- Example:
-
- #include <stdio.h>
-
- printf("The current video display page is: %d\n",current_page());
-
-
- cursor_off
- Summary:
-
- int cursor_off();
-
- Created: 02/22/86 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This function will turn the cursor off using the technique used
- by graphics modes in order to make it 'invisible.'
-
- Compiler Specifics:
-
- Compiled with MSC 3.0. Only specific is use of register
- structures of MSC and int86(). Usually needs a change like
- sysint() instead of int86(). Check section three of this manual.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- cursor_on()
-
- Example:
-
- cursor_off();
-
-
- cursor_on
- Summary:
-
- int cursor_on();
-
- Created: 02/22/86 Last Updated: 05/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- Doing the opposite of the cursor_off() function this function
- restores the cursor and returns the shape (scan lines) to their
- default state.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0. Only specific is use of register
- structures of MSC and int86(). Usually needs a change like
- sysint() instead of int86(). Check section three of this manual.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- cursor_off()
-
- Example:
-
- cursor_off();
-
- cursor_on();
-
-
- cursor_read
- Summary:
-
- int cursor_read(row,col)
- int *row; /* Location to Store Row */
- int *col; /* Location to Store Col */
-
- Created: 02/22/86 Last Updated: 02/22/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This funciton places the current cursor positions into row and
- col, using the video BIOS interrupt.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0. Only specific is use of register
- structures of MSC and int86(). Usually needs a change like
- sysint() instead of int86(). Check section three of this manual.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- gotoxy()
-
- Example:
-
- int x;
- int y;
- cursor_read(&x,&y);
- gotoxy(x+2,y-3); /* Move diagonally down and left. */
-
-
- cursor_size
- Summary:
-
- int cursor_size(start,end);
- int start; /* Starting Scan Line */
- int end; /* Ending Scan Line */
-
- Created: 02/22/86 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This funciton sets the cursor scan lines to start and finish.
- Note that specifying a larger start then finish line causes it to
- wrap around and form a two part cursor.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0. Only specific is use of register
- structures of MSC and int86(). Usually needs a change like
- sysint() instead of int86(). Check section three of this manual.
-
- Return Value:
-
- None.
-
- See Also:
-
- cursor_on() cursor_off()
-
- Example:
-
- cursor_size(6,7); /* Sets cursor to two line underline */
- /* in color mode. */
-
-
- cvline
- Summary:
-
- int cvline(y,x,x2,type);
- int y; /* Upper Left Col */
- int x; /* Upper Left Row */
- int x2; /* Lower Right Row */
- int type; /* Style of Border */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: putchci() gotoxy()
-
- Description:
-
- This function will draw a line at x,y to x2,y using the
- character(s) specified in type. Type may be any one of the five
- types accepted by box(). Usually this function is used to draw
- lines inside boxes, as it will use the proper top and bottom
- characters, but by using an ASCII character in type an ordinary
- line of that character is drawn. The line is drawn in the
- current color, as specified by color().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns a one if successful, a negative one if invalid
- coordinates are passed.
-
- See Also:
-
- chline() wvline()
-
- Example:
-
- #include <color.h> /* Just for the colors... */
-
- color(RED_F,WHT_B); /* Red on White */
-
- cbox(5,5,20,60,1); /* A box with a single line border */
-
- cvline(7,5,20,1); /* Draws a line down the box */
-
-
- dirwin
- Summary:
-
- int dirwin(path,name);
- char *path; /* Path, With Drive */
- char *name; /* Template for File Name */
-
- Created: 04/20/86 Last Updated: 04/22/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: DIRWIN.OBJ DIRWIN.C
-
- Requires: ffirst() fnext()
-
- Description:
-
- This routine opens a window in the current colors in which the
- specified directory is displayed in four columns of nine file
- names. When a directory exceeds thirty-six file names a key
- press clears the window and displays the next thirty-six, and so
- on until the last screen is displayed, after which the window is
- closed.
-
- The pathname should include the drive letter and subdirectory
- path. If the root is being used at least the \ should be in
- path. The title used is "[ Dir: %s\\%s ]",path,name. An
- appropriate path and template might be: "A:\\","*.*".
-
- The file names are displayed once in the order they are found on
- the disk. (The same order with the DIR command at the DOS
- prompt.) The filenames are left justified in their columns with
- a dot separater between the name and extension.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
-
-
- Example:
-
- dirwin("C:\\C","*.C");
-
-
- dummy
- Summary:
-
- #include <csrmisc.h>
-
- dummy();
-
- Created: 04/14/86 Last Updated: 04/14/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CSRMISC.H
-
- Requires: Nothing.
-
- Description:
-
- This is undoubtedly the most useless function in the library, but
- it was to easy to exclude. The macro does absolutly nothing, it
- simply holds a spot during development, indicating a function.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
-
-
- Example:
-
- #include <csrmisc.h>
-
- /* Next line shows how it could be used. */
-
- dummy(); /* This will be the callbak() function call. */
-
-
- ffirst
- Summary:
-
- #include <csrdos.h> /* Contains struct DIRS, for buf */
-
- int ffirst(dir,buf,template,attr);
- char *dir; /* Subdir to Use */
- char *buf; /* Location to Store Data */
- char *template; /* FileName/Template to Search for */
- int attr; /* Attribute to Include in Search */
-
- Created: 04/04/86 Last Updated: 04/15/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: DIRSRCH.OBJ
-
- Requires: intdos()
-
- Description:
-
- Using DOS 2.0 function 0x4e (2.00 and above only) this function
- begins the search for a file in the specified directory using
- either a file name or template with wildcard characters ( ? * )
- as the file to search for. The path must be a standard DOS path
- name (without file name), using two backslashes instead of one.
- If the path to search is the root, use the path string of "".
-
- The attribute specified in attr is the attribute to use in the
- search. If none is specified, then only files are reported. If
- the volume attribute is used, the volume label is returned. If
- the sub-directory attribute is specified, all files AND sub-
- directories are returned. The same applies to the hidden and
- and system attributes, but the archive and read-only attributes
- can not be used in searches.
-
- After a file is found it's data is placed in buf (consult
- CSRDOS.H for the DIRS structure). The entry type may be
- determined by & ing the returned attribute and the attribute you
- wish to test for, as in if ( buf.attr & SUBDIR ) would be true
- if the entry was a subdirectory.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns the value of the AX register, 2 for file not found, and
- 18 for no more files to be found.
-
- See Also:
-
- fnext()
-
-
- ffirst
-
-
-
-
- Example:
-
- #include <csrdos.h>
-
- struct DIRS buf;
-
- ffirst("",&buf,"*.SYS",0); /* Find first .SYS file in root. */
-
-
- fnext
- Summary:
-
- #include <csrdos.h> /* Contains struct DIRS, for buf */
-
- int fnext(dir,buf,template,attr);
- char *dir; /* Subdir to Use */
- char *buf; /* Location to Store Data */
- char *template; /* FileName/Template to Search for */
- int attr; /* Attribute to Include in Search */
-
- Created: 04/04/86 Last Updated: 04/15/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: DIRSRCH.OBJ
-
- Requires: intdos()
-
- Description:
-
- Using DOS 2.0 function 0x4f (2.00 and above only) this function
- continues the search begun with ffirst(). This function is
- dependant upon information left in the first 21 bytes of the
- buffer used in ffirst, so use the same buffer, or begin a new
- sequence with ffirst().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns the value of the AX register, 18 for no more files to be
- found, or nothing.
-
- See Also:
-
- ffirst().
-
- Example:
-
- #include <csrdos.h>
-
- int x;
- struct DIRS buf;
-
- ffirst("",&buf,"*.SYS",0); /* Find first .SYS file in root. */
-
- while ( x != 18 )
- {
- printf("%s %ld\n",buf.name,buf.size); /* Print name & size. */
- x = fnext("",&buf,"*.SYS",0); /* Find next entry. */
- }
-
-
- get_date
- Summary:
-
- int get_date(dy,mn,yr);
- int *dy; /* Location of Day */
- int *mn; /* Location of Month */
- int *yr; /* Location of Year */
-
- Created: 03/31/86 Last Updated: 03/31/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: GET_DATE.OBJ
-
- Requires: intdos()
-
- Description:
-
- This routine obtains the current date by using the DOS interrupt
- 0x2a, and places it into the variables specified. The day starts
- with numbering with 1, and continue to a maximum of 31, the month
- is numbered from 1 to 12, and the year is from 1980 to 2099.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0, uses the dosint() function and register
- unions specified in DOS.H.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_dow() set_date() get_time()
-
- Example:
-
- int d;
- int m;
- int y;
-
- get_date(d,m,y);
-
- printf("Today is %d/%d/%d.\n",m,d,y);
-
-
- get_dow
- Summary:
-
- int get_dow();
-
- Created: 03/31/86 Last Updated: 03/31/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: GET_DOW.OBJ
-
- Requires: intdos()
-
- Description:
-
- This routine returns the day of the week, 0 for sunday, 1 for
- monday, etc. It is obtained with a DOS interrupt.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0, uses the dosint() function and register
- unions specified in DOS.H.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_date() get_time()
-
- Example:
-
- printf("Today is the %d day of the week.\n",get_dow());
-
-
- get_drive
- Summary:
-
- int get_drive();
-
- Created: 04/04/86 Last Updated: 04/04/86
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: GETDRIVE.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function returns a single integer representing the current
- logical drive. The drives are number from 0, as in 0 = A, 1 = B,
- 2 = C, etc. Remember that even with only one floppy, DOS will
- still have an A and B drive, with the single floppy acting as
- both.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- The current drive.
-
- See Also:
-
- set_drive() num_drives()
-
- Example:
-
- printf("Current Drive is: %c:\n",'A'+get_drive());
-
-
- get_mode
- Summary:
-
- int get_mode();
-
- Created: 04/16/86 Last Updated: 04/16/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: GETMODE.OBJ
-
- Requires: int86()
-
- Description:
-
- This function returns the current video mode.
-
- Compiler Specifics:
-
- Other then int86(), none.
-
- Return Value:
-
- The current video mode.
-
- See Also:
-
- set_mode()
-
- Example:
-
- #include <stdio.h>
-
- printf("Current video mode is: %d\n",get_mode());
-
-
- get_time
- Summary:
-
- int get_time(hr,mn,sc,hn);
- int *hr; /* Location of Hour */
- int *mn; /* Location of Minutes */
- int *sc; /* Location of Seconds */
- int *hn; /* Location of Hundredths */
-
- Created: 03/31/86 Last Updated: 03/31/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: GET_TIME.OBJ
-
- Requires: intdos()
-
- Description:
-
- Using DOS interrupt 0x2c this routine obtains the current time,
- to the hundredths, and places it in the variables specified. The
- time is given in 24 hour format, and everything starts counting
- at 0, 0 to 23 hours, 0 to 59 seconds etc.
-
- Compiler Specifics:
-
- Compiled with MSC 3.0, uses the dosint() function and register
- unions specified in DOS.H.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_dow() get_date() set_time()
-
- Example:
-
- int h;
- int m;
- int s;
- int hn;
-
- get_time(h,m,s,hn);
-
- printf("The time is %d:%d:%d.%d.\n",h,m,s,hn);
-
-
- gotoxy
- Summary:
-
- int gotoxy(row,col);
- int row; /* Screen Row */
- int col; /* Screen Column */
-
- Created: 00/00/00 Last Updated: 00/00/00
-
- Author: Source (C/A): A
-
- Located in: GOTOXY.OBJ
-
- Requires: Nothing
-
- Description:
-
- The gotoxy function will set the cursor to the screen coordinates
- specified in row and col, regardless of windows or other high-
- level screen manipulation.
-
- Service two of the bios video interrupt 0x10 is used.
-
- Compiler Specifics:
-
- Assembled with calling sequence for MSC 3.0 and Lattice. Other
- compilers not yet tested. Standard Microsoft OBJ format.
-
- Return Value:
-
- This routine returns nothing, and does not check coordinate
- validity.
-
- See Also:
-
- wgotoxy()
-
- Example:
-
- #include <stdio.h>
-
- int row;
- int col;
-
- row = 10;
- col = 20;
-
- gotoxy(row,col);
-
- printf("I am now at Column 20 on Row 10.\n");
-
-
- lprint
- Summary:
-
- int lprint(string);
- char *string; /* String to Print */
-
- Created: 03/10/86 Last Updated: 03/11/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PRINT.OBJ
-
- Requires: lputchar()
-
- Description:
-
- This function simply prints the string to the printer. Nothing
- other then the standard escape codes are recognized.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wprint()
-
- Example:
-
- lprint("This string has no formatting at all.\n");
-
-
- lprintf
- Summary:
-
- int lprintf(string[,arguments...]);
- char *string; /* Format String to Print */
-
- Created: 03/10/86 Last Updated: 03/11/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PRINT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function is a version of the familiar printf() function that
- prints directly to the printer. (Note that DOS function 5 is
- used, it is not done through file pointers.) The argument
- formatting should be in the same format as for printf().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wprintf()
-
- Example:
-
- lprintf("This goes to the printer: %02d %5s\n",6,"Wow");
-
-
- lputchar
- Summary:
-
- int lputchar(c);
- int c; /* Character to Print */
-
- Created: 03/10/86 Last Updated: 03/11/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PRINT.OBJ
-
- Requires: bdos()
-
- Description:
-
- Using the bdos call five this routine simply puts the character c
- to the printer. It is called by lprint().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- lprint() lprintf()
-
- Example:
-
- lputchar('\r');
-
-
- match
- Summary:
-
- int match(pat,str,start);
- char pat[]; /* Pattern to Search for */
- char str[]; /* String to Search in */
- int start; /* Character to Start on */
-
- Created: 11/23/85 Last Updated: 11/23/85
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: MATCH.OBJ
-
- Requires: strlen()
-
- Description:
-
- The match() function searches the string str for the string pat,
- and returns an integer value of the first place pat is found
- within str. By changing the variable start from it's normal
- useage as 0, you may begin the search from a certain place in
- str. The following wildcards are acceptable within pat:
-
- # Any digit from 1-9, and 0
- ? Any character at all
- ! Any upper-case letter
- ^ Any control character
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns the first place that pat is found within str.
-
- See Also:
-
-
- Example:
-
- x = match("a?c","xyzabc",0); /* x = 3, where abc begins. */
-
-
- mcolor
- Summary:
-
- #include <color.h> /* For Color Definitions Only */
-
- int mcolor(norm,bar);
- int norm; /* Color Used for Menu Options */
- int bar; /* Color for Hightlight Bar */
-
- Created: 04/16/86 Last Updated: 04/16/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function sets the colors to be used by pop_menu() and it's
- scrolling highlight bar. The variable norm contains the complete
- attribute for each option, and bar for the highlight bar.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- color() wcolor()
-
- Example:
-
- #include <color.h>
-
- mcolor(WHT_F+BLU_B,YEL_F+RED_B);
-
-
- num_drives
- Summary:
-
- int num_drives();
-
- Created: 04/06/86 Last Updated: 04/06/86
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: NUMDRVS.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function returns a single integer value, the number of
- logical drives available. Remember that although this function
- returns the number of available drives, access to these drives is
- numbered from zero, so if 3 drives are reported, the highest
- number that may be accessed is 2.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- The total number of logical drives installed.
-
- See Also:
-
- get_drive() set_drive()
-
- Example:
-
- printf("%d drives installed. A: - %c:\n",num_drives(),
- ( 'A' + ( num_drives() - 1 ) ));
-
-
- pop_menu
- Summary:
-
- int pop_menu(x,y,num,args,title,type);
- int x; /* Row to Start on */
- int y; /* Col to Start on */
- int num; /* Number of Options */
- char *args[]; /* Function Names */
- char *title; /* Menu Title */
- int type; /* Window Type */
-
- Created: 03/09/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: wopen() wclose() wtitle()
-
- Description:
-
- This function opens a window at x,y titled with the string
- pointed to by title, of type border style, and with num options
- stored in args[]. The window's width is the size of the maximum
- length option. The options are printed as sent to the routine,
- but for a clean highligh bar, and better performance all the
- options should be centered previously in a string. See the demo
- programs for more examples of this. Also note, after an option
- is selected with the highlight bar, the it's number is returned,
- and the window closed. You must reopen the menu, this preferably
- done in a loop[ structure that opens the menu, processes the
- resulting code, and then reopens the menu. This system is a
- simple building block for more advanced menu design.
-
- Compiler Specifics:
-
- See window notes.
-
- Return Value:
-
- The number of the option selected with the highlight bar, or a -1
- signifying the user aborted the menu with the ESC key.
-
- See Also:
-
- mcolor()
-
-
- pop_menu
-
-
-
-
- Example:
-
- #include <color.h>
-
- static char *array[] =
- {
- " Option 1 ",
- " Option 2 ",
- " Quit "
- };
-
- main()
- {
- int x;
- cls();
-
- while ( 1 )
- {
-
- /* Inside doesn't matter, mcolor() does that, so we use wcolor
- only to set our border. Then mcolor() will set our menu
- colors. (Color definition in loop in case other routines
- change them.) */
-
- wcolor(BLK_F,BLU_F+WHT_B);
- mcolor(YEL_F+RED_B,WHT_F+BLU_B);
-
- x = pop_menu(9,27,3,array," Menu ",3);
- if ( x == 0 )
- opt1();
- else if ( x == 1 )
- opt2();
- else if ( x == 2 || x == -1 )
- exit(0);
- }
- }
-
-
- print_screen
- Summary:
-
- int print_screen();
-
- Created: 03/10/86 Last Updated: 03/10/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PRINT.OBJ
-
- Requires: int86()
-
- Description:
-
- Performing the exact same feature as if you had hit the PrtSc key
- while holding the shift key down, this routine prints the screen
- with the bios interrupt five.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
-
-
- Example:
-
- print_screen();
-
-
- prtrns
- Summary:
-
- int prtrns(c);
- int c; /* Character to translate */
-
- Created: 02/22/86 Last Updated: 02/22/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PRTRNS.C PRTRNS.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function is a simple one that takes c as an argument, and if
- it is a special box drawing character form the extended character
- set it is translated into an equivalent in the lower 127 ASCII
- range. Possibly useful in writing a screen or text dump that
- originally contained special characters.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Returns the character, translated if neccessary.
-
- See Also:
-
-
-
- Example:
-
- #include <stdio.h>
-
- int c = 179;
-
- c = prtrns(c); /* Would return |, replacing 179. */
-
- putc(c,stdprn);
-
-
- putat
- Summary:
-
- int putat(x,y,string);
- int x; /* Row to Put At */
- int y; /* Col to Put At */
- char *string; /* String to Put */
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PUTAT.OBJ
-
- Requires: ccputs() putchci()
-
- Description:
-
- This function places the specified string at x,y on the global
- screen.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- putatf() wputat() wputatf()
-
- Example:
-
- putat(10,25,"+ The plus is at 10,25.");
-
-
- putatf
- Summary:
-
- int putatf(x,y,string,args...);
- int x; /* Row to Put At */
- int y; /* Col to Put At */
- char *string; /* Formatted String to Put */
- args... /* Formatting Arguments */
-
- Created: 05/01/86 Last Updated: 05/01/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: PUTATF.OBJ
-
- Requires: ccputs() putchci()
-
- Description:
-
- This performs the same function as putat() with the addition of
- up to 15 formatting arguments in the same format as printf().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- putat() wputat() wputatf()
-
- Example:
-
- putatf(10,25,"+ The plus %s at %d,%d.","is",10,25);
-
-
- putchci
- Summary:
-
- int putchci(c,color);
- int c; /* Character to Print */
- int color; /* Attribute to Use */
-
- Created: 12/28/85 Last Updated: 12/28/85
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: PUTCHCI.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This simply outputs the character c, using the color in color, to
- the video memory, and then increments the cursor.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wputchar()
-
- Example:
-
- #include <color.h>
-
- putchci('A',RED_F+BLK_B); /* Put out an A in red. */
-
-
- restore
- Summary:
-
- int restore(x,y,x2,y2,array);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- char *array; /* Array to Store Screen In */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function restores the portion of the screen previously saved
- by save() in array at the coordinates which are specified, which
- don't have to be the same as those at which it was saved.
-
- Compiler Specifics:
-
- The MSC function movedata() was used.
-
- Return Value:
-
- Nothing is returned and there are no validity checks. Giving a
- set of bad coordinates will generate unknown results.
-
- See Also:
-
- save() restore_screen()
-
- Example:
-
- char *temp;
- temp = malloc(4000); /* Size of screen and attributes. */
-
- save(0,0,24,79,temp); /* Save whole screen. */
-
- restore(0,0,24,79,temp); /* Restore screen. */
-
-
- restore_cursor
- Summary:
-
- int restore_cursor();
-
- Created: 02/22/86 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This function will return the cursor to the location it was at
- when save_cursor() was called.
-
- Compiler Specifics:
-
- Problems associated with int86() only.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- save_cursor() restore_screen()
-
- Example:
-
- save_cursor();
-
- restore_cursor();
-
-
- restore_screen
- Summary:
-
- int restore_screen();
-
- Created: 03/09/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: restore()
-
- Description:
-
- This function restores the screen saved with save_screen().
- Useful for restoring the screen present when a program was
- invoked after it finishes executing.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- save_screen() restore_cursor()
-
- Example:
-
- main()
- {
- save_screen();
-
- /* Etc... */
-
- restore_screen();
- exit(0);
- }
-
-
- save
- Summary:
-
- int save(x,y,x2,y2,array);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- char *array; /* Array to Store Screen In */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function saves the portion of the screen specified by the
- four coordinates into array. No other action is taken, and the
- screen is not erased within that area.
-
- Compiler Specifics:
-
- The MSC function movedata() was used.
-
- Return Value:
-
- Nothing is returned and there are no validity checks. Giving a
- set of bad coordinates will generate unknown results.
-
- See Also:
-
- restore() save_screen()
-
- Example:
-
- char *temp;
- temp = malloc(4000); /* Size of screen and attributes. */
-
- save(0,0,24,79,temp); /* Save whole screen. */
-
- restore(0,0,24,79,temp); /* Restore screen. */
-
-
- save_cursor
- Summary:
-
- int save_cursor();
-
- Created: 02/22/86 Last Updated: 02/24/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: CURSOR.OBJ
-
- Requires: int86()
-
- Description:
-
- This funciton will save the current cursor position in an
- internal variable for restoration with restore_cursor() at a
- later time.
-
- Compiler Specifics:
-
- int86().
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- restore_cursor()
-
- Example:
-
- save_cursor(); /* Save it here... */
-
- printf("This is a string of text...");
-
- restore_cursor(); /* To the beginning of the line... */
-
-
- save_screen
- Summary:
-
- int save_screen();
-
- Created: 03/09/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: save()
-
- Description:
-
- This function saves the current screen and attributes for later
- restoration with the restore_screen() function.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- save_cursor() restore_screen()
-
- Example:
-
- main()
- {
- save_screen();
-
- /* Etc... */
-
- restore_screen();
- exit(0);
- }
-
-
- scroll
- Summary:
-
- int scroll(x,y,x2,y2,dir,num);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- int dir; /* 0 - Up / 1 - Down */
- int num; /* Number of Lines */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: int86()
-
- Description:
-
- This function scrolls the area inside and including the specified
- coordinates in the specified window. The number of lines
- scrolled is determined by the value of num and setting num to 0
- and the direction 0, up, will cause the window to clear
- completly.
-
- Compiler Specifics:
-
- None other then int86() related.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wscroll()
-
- Example:
-
- scroll(0,0,24,80,0,0); /* Clear the whole screen. */
-
-
- set_date
- Summary:
-
- int set_date(dy,mn,yr);
- int dy; /* Day */
- int mn; /* Month */
- int yr; /* Year */
-
- Created: 03/31/86 Last Updated: 03/31/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: SET_DATE.OBJ
-
- Requires: intdos()
-
- Description:
-
- Using the DOS interrupts this routine sets the date as specified
- in the three parameters. For more information see the
- description of get_date();
-
- Compiler Specifics:
-
- Compiled with MSC 3.0, uses the dosint() function and register
- unions specified in DOS.H.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_dow() get_date() set_time()
-
- Example:
-
- int d = 4;
- int m = 7;
- int y = 1987;
-
- set_date(d,m,y); /* Fourth of July, 1987. */
-
-
- set_drive
- Summary:
-
- int set_drive(x);
- int x; /* Drive Numer to Set to */
-
- Created: 04/06/86 Last Updated: 04/06/86
-
- Author: Bob Pritchett Source (C/A): A
-
- Located in: SETDRIVE.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function sets the current drive to the number specified by
- x. For an explanation of numbering conventions, see get_drive().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_drive() num_drives()
-
- Example:
-
- if ( num_drives() != 1 ) /* If we have more then 2 logical */
- set_drive(2); /* Make the current the first HD, C: */
- else
- set_drive(0); /* Else make it A: */
-
-
- set_mode
- Summary:
-
- #include <csrmodes.h> /* For Declarations Only */
-
- int set_mode(x);
- int x; /* Video Mode to Set to */
-
- Created: 05/03/86 Last Updated: 05/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: SETMODE.OBJ
-
- Requires: int86()
-
- Description:
-
- This function sets the video mode as specified in x. Please see
- CSRMODES.H for a description of these modes.
-
- Compiler Specifics:
-
- None other then int86() related.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_mode()
-
- Example:
-
- #include <csrmodes.h>
-
- set_mode(CO80); /* 80 Columns - Color */
-
-
- set_time
- Summary:
-
- int set_time(hr,mn,sc,hn);
- int hr; /* Hour */
- int mn; /* Minutes */
- int sc; /* Seconds */
- int hn; /* Hundredths */
-
- Created: 03/31/86 Last Updated: 03/31/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: SET_TIME.OBJ
-
- Requires: intdos()
-
- Description:
-
- This routine uses DOS to set the current time as specified. For
- more information see the description of get_time().
-
- Compiler Specifics:
-
- Compiled with MSC 3.0, uses the dosint() function and register
- unions specified in DOS.H.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- get_dow() set_date() get_time()
-
- Example:
-
- int h = 3;
- int m = 15;
- int s = 0;
- int hn = 0;
-
- set_time(h,m,s,hn); /* Set the time to 3:15am. */
-
-
- timer
- Summary:
-
- int timer();
-
- Created: 04/14/86 Last Updated: 04/14/86
-
- Author: Unknown Source (C/A): C
-
- Located in: TIMER.OBJ
-
- Requires: int86()
-
- Description:
-
- This routine will return an integer representing the number of
- clock ticks since the last call. Remember that there are about
- 18.2 ticks per second.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- The number of ticks since last call.
-
- See Also:
-
-
-
- Example:
-
- timer(); /* Start count... */
- routiner();
- printf("routine() took %d ticks to execute.\n",timer());
-
-
- wactivate
- Summary:
-
- int wactivate(wind);
- int wind; /* Pointer to Window to Activate */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function activates the specified window. If the window is
- overlayed by other windows it is brought out from behind and
- becomes the active window, on top of the other and uncovered.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wclose() wopen()
-
- Example:
-
- wactivate(w3); /* Activate an opened window */
-
-
- wborder
- Summary:
-
- int wborder(num,type);
- int num; /* Number of Window to Use */
- int type; /* Type of Window Border to Use */
-
- Created: 04/25/86 Last Updated: 04/25/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function redraws the border of a window, using whatever type
- is specified, and the colors stored for this window. The most
- useful purpose is to 'erase' wtitle() and wmessage() messages,
- and to change the style of the border.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wcolor()
-
- Example:
-
- wborder(win,4);
-
-
- wblank
- Summary:
-
- int wblank(wind,row);
- int wind; /* Pointer to Window to Use */
- int row; /* Row to Clear */
-
- Created: 04/30/86 Last Updated: 04/30/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function will erase the specified row within the specified
- window by deleting then inserting that row. The cursor is place
- at column 0 in this row.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- winsert() wdelete()
-
- Example:
-
- wblank(win,3);
-
-
- wcenter
- Summary:
-
- int wcenter(win,x,str);
- int win; /* Window to Use */
- int x; /* Line to Center on */
- char *str; /* String to Center */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: WCENTER.OBJ
-
- Requires: wgotoxy() wprint()
-
- Description:
-
- This routine is functionally the same as center() except that x
- is a line within the specified window, and the string is centered
- in window coordinates, not global. The window's inside color is
- used.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wcenterf() center()
-
- Example:
-
- wcenter(w3,5,"This is centered in window 3.");
-
-
- wcenterf
- Summary:
-
- int wcenterf(win,x,str[,arguments...]);
- int win; /* Window to Use */
- int x; /* Line to Center on */
- char *str; /* String to Center */
-
- Created: 04/13/86 Last Updated: 04/13/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: WCENTERF.OBJ
-
- Requires: wgotoxy() wprint()
-
- Description:
-
- Just like centerf() only in the specified window.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- center() centerf() wcenter()
-
- Example:
-
- wcenterf(w3,5,"This is %s in window 3.","centered");
-
-
- wclose
- Summary:
-
- int wclose(wind);
- int wind; /* Pointer to Window to Close */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function closes a video window previously opened with
- wopen(). The portion of the screen that was covered with the
- window is restored. NOTE: You may close a window other then the
- active one, it will be acitivated and properly closed.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wcloseall() wopen() wactivate()
-
- Example:
-
- int w;
-
- w = wopen(10,10,20,70,2); /* Open a large window */
-
- wclose(w); /* Restore covered screen area */
-
-
- wcloseall
- Summary:
-
- int wcloseall();
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function closes all the open windows by repeatedly calling
- wclose(). The active window is closed first, and so on all the
- way down the stack.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wclose() wopen() wactivate()
-
- Example:
-
- int w;
- int w2;
-
- w = wopen(10,10,20,70,2); /* Open a large window */
- w2 = wopen(5,5,17,54,3);
-
- wcloseall(); /* Restore covered screen area */
-
-
- wcls
- Summary:
-
- int wcls(num);
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine will clear the specified window with it's current
- interior attributes. If not active the cleared window will
- become the foremost window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- cls() ccls()
-
- Example:
-
- wcls(win); /* Clear window win. */
-
-
- wcol
- Summary:
-
- int wcol(wind);
- int wind; /* Pointer to Window to Use */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function returns the number of the highest col in a window.
- If a window has siz columns, numbered zero to five, wcol() will
- return a five. Mostly an internal routine.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wrow()
-
- Example:
-
- x = wcol(w3); /* Returns the number of highest row */
-
-
- wcolor
- Summary:
-
- int wcolor(insd,bord);
- int insd; /* Color For Window Interior */
- int bord; /* Color For Window Border */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine sets the current colors for the inside and outside
- of windows. These are the defaults used when a window is
- created. The difference between color() and wcolor() primarily
- is that color has two arguments, the fore and background colors,
- and wcolor makes you add the fore and back into one number for
- both the inside and border colors. Also, the color() function
- sets both border and inside attributes to be the same, while
- wcolor() allows them to be set to different values.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- color()
-
- Example:
-
- wcolor(WHT_F+BLU_B,BLU_F+WHT_F);
- /* Inside is white on blue, border is blue on white. */
-
-
- wdelete
- Summary:
-
- int wdelete(num,row,tms)
- int num; /* Pointer to Window to Use */
- int row; /* Row to Delete Line Before */
- int tms; /* Number of Lines to Delete */
-
- Created: 04/30/86 Last Updated: 04/30/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine deletes tms lines starting with the line number in
- row, and moves all lower lines up, making blanks at the bottom of
- the window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- winsert() wblank()
-
- Example:
-
- wdelete(win,2,4); /* Delete 4 line starting with line 2,
- so line 6 becomes line 2 etc. */
-
-
- wfreeze
- Summary:
-
- int wfreeze(num,top,bot);
- int num; /* Pointer to Window to Use */
- int top; /* First Scrollable Line */
- int bot; /* Last Scrollable Line */
-
- Created: 04/16/86 Last Updated: 04/16/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine allows you to set the scrollable lines within a
- window. When text a newline is printed on the last line inside a
- window, the text scrolls up. This routine allows you to 'freeze'
- a number of lines at the top and bottom of the window. The
- numbers specified are the first and last scrollable lines, and
- the default, full window, values are 0 and wrow(num).
-
- No error checking is performed on the values.
-
- The wcls() routine will only clear scrollable lines, and whome()
- will home the cursor to the first character on the first
- scrollable line. Reset the wfreeze() values to 0 and wrow(num)
- to clear an entire window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
-
-
- Example:
-
- wfreeze(w2,2,wrow(w2)-3); /* Freeze lines 0-1 at top, and the
- bottom three lines. */
-
-
- wgotoxy
- Summary:
-
- int wgotoxy(num,row,col);
- int num; /* Pointer to Window to Use */
- int row; /* Row In Window to Go To */
- int col; /* Col In Window to Go To */
-
- Created: 03/03/86 Last Updated: 04/16/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine perfomrs the same function as gotoxy() within window
- coordinates. Remember that as on the screen, window coordinates
- start numbering at 0,0.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- gotoxy() whome()
-
- Example:
-
- wgotoxy(w1,2,4); /* Put cursor at 2,4 in window 1. */
-
-
- whline
- Summary:
-
- int whline(wind,row);
- int wind; /* Window to Draw in */
- int row; /* Row to Draw Line on */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: chline()
-
- Description:
-
- This function calls chline() with the correct parameters to draw
- a horizontal line in the specified window. The correct colors
- and border styles are used.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- chline() wvline()
-
- Example:
-
- #include <color.h> /* Just for the colors... */
-
- int w;
-
- w = wopen(5,5,20,60,1); /* A box with a single line border */
-
- whline(w,7); /* Draws a line across the box */
-
-
- whome
- Summary:
-
- int whome(num);
- int num; /* Pointer to Window to Use */
-
- Created: 04/20/86 Last Updated: 04/20/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine homes the cursor to the same coordinates as would be
- used in a window clear with wcls(), the upper left scrollable
- character in the specified window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- gotoxy() wgotoxy()
-
- Example:
-
- wfreeze(w,3,wrow(num)); /* First three lines frozen. (0-2) */
- whome(w); /* Cursor goes to 3,0. */
-
-
- winsert
- Summary:
-
- int winsert(num,row,tms)
- int num; /* Pointer to Window to Use */
- int row; /* Row to Insert Line Before */
- int tms; /* Number of Lines to Insert */
-
- Created: 04/30/86 Last Updated: 04/30/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine inserts tms lines before the specified line in the
- specified window, scrolling all lines below down tms. The cursor
- goes to the first column in the first new line.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wdelete() wblank()
-
- Example:
-
- winsert(win,3,2); /* Insert two lines before line 3,
- new lines become 3 and 4, 3 becomes
- line 5. */
-
-
- wjump
- Summary:
-
- int wjump(wind,x,y);
- int wind; /* Pointer to Window to Jump */
- int x; /* Upper Right Row */
- int y; /* Upper Right Col */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function activates and moves the specified window to the x,y
- coordinates given. The window instantly 'jumps', placing it's
- upper right hand corner at x,y.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wmove()
-
- Example:
-
- wjump(w2,10,10); /* Jumps window w2 to 10,10 */
-
-
- wmessage
- Summary:
-
- int wmessage(win,str,val);
- int win; /* Window to Use */
- char *str; /* Message to Use */
- int val; /* Message Location */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: wprint()
-
- Description:
-
- Using the window's border attribute, this function prints a
- message to the user on the bottom border. For more information
- see the description of wtitle().
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wtitle()
-
- Example:
-
- wmessage(w,"< Press a Key >",0);
-
-
- wmove
- Summary:
-
- int wmove(wind,dir);
- int wind; /* Pointer to Window to Move */
- int dir; /* Direction to Move Window */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function will activate and move the specified window one
- space in the direction given in dir. The dir value is a number
- from one to four, up, right, down, and left, respectively.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wjump()
-
- Example:
-
- wmove(w2,10,10); /* Jumps window w2 to 10,10 */
-
-
- wopen
- Summary:
-
- int wopen(x,y,x2,y2,type);
- int x; /* Upper Left Row */
- int y; /* Upper Left Col */
- int x2; /* Lower Right Row */
- int y2; /* Lower Right Col */
- int type; /* Type of Border */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: cbox()
-
- Description:
-
- This function opens a video window. The current video attributes
- are used, the portion of the screen covered is saved, and then
- blanked with the interior color. The argument type may be of any
- one of the valid types used by box() and cbox().
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Returns a type int value needed to reference the window at a
- later time.
-
- See Also:
-
- wclose() wactivate()
-
- Example:
-
- int w;
-
- w = wopen(10,10,20,70,2); /* Open a large window */
-
-
- wprint
- Summary:
-
- int wprint(win,str);
- int win; /* Window to Use */
- char *str; /* String to Print */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: putchci()
-
- Description:
-
- Using the window's inside attributes, the string is printed at
- the current cursor position within the specified window, which is
- activated if it is not already so. The following escape
- characters may be used:
-
- \n Newline
- \t Tab
- \r Return
- \f Form-Feed, clear window
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wprintf()
-
- Example:
-
- wprint(w3,"This line is outputted where the cursor is.\n");
-
-
- wprintf
- Summary:
-
- int wprintf(win,str,args...);
- int win; /* Window to Use */
- char *str; /* Formatted String to Print */
- args... /* Formatting Arguments */
-
- Created: 03/09/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: WPRINTF.OBJ
-
- Requires: wprint()
-
- Description:
-
- This function supports the full formatting capabilities of the
- regular printf() function, only it prints to the specified
- window. A maximum of 15 formatting arguments may be included, it
- is unlikely more should be needed.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wprint()
-
- Example:
-
- wprintf(w2,"This is formatting... %03d %s.\n",38,"times");
-
-
- wputat
- Summary:
-
- int wputat(win,x,y,string);
- int win; /* Window to Use */
- int x; /* Row to Print on */
- int y; /* Column to Print at */
- char *string; /* String to Print */
-
- Created: 03/09/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: WPUTAT.OBJ
-
- Requires: wgotoxy() wprint()
-
- Description:
-
- This routine will place the string in the window specified at the
- coordinates specified. If not active the specified window will
- be activated.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- putat()
-
- Example:
-
- wputat(win,4,5,"+ The plus sign is at 4,5 in window win.");
-
-
- wputatf
- Summary:
-
- int wputatf(num,row,col,string,args...)
- int num; /* Pointer to Window to Use */
- int row; /* Row Coordinate */
- int col; /* Col Coordinate */
- char *string; /* Format String */
- args... /* Formatting Arguments */
-
- Created: 05/01/86 Last Updated: 05/01/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: WPUTATF.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This routine performs the same function as putatf() only within
- the specified window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- putatf() wputat() putat()
-
- Example:
-
- wputatf(win,4,6,"This line at %d,%d.",4,6);
-
-
- wputchar
- Summary:
-
- int wputchar(num,c);
- int num; /* Number of Window to Use */
- int c; /* Character to Output in Window */
-
- Created: 04/25/86 Last Updated: 04/25/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function simply outputs the character at the current
- position of the specified window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wprint() wprintf()
-
- Example:
-
- wputchar(win,'\n');
-
-
- wrow
- Summary:
-
- int wrow(wind);
- int wind; /* Pointer to Window to Use */
-
- Created: 03/03/86 Last Updated: 03/09/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function returns the number of the highest row in a window.
- If a window has four lines, numbered zero to three, wrow() will
- return a three. Mostly an internal routine.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wcol()
-
- Example:
-
- x = wrow(w3); /* Returns the number of highest row */
-
-
- wscroll
- Summary:
-
- int wscroll(num,dir,tms)
- int num; /* Number of Window to Use */
- int dir; /* Direction to Scroll in */
- int tms; /* Number of Lines to Scroll */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: Nothing.
-
- Description:
-
- This function will scroll the specified window tms lines in the
- specified window. The direction is 0 for up, or 1 for down.
- Specifying 0 lines will clear the window.
-
- Compiler Specifics:
-
- Compiled with MSC. See window notes.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- scroll()
-
- Example:
-
- wscroll(win,0,1);
-
-
- wtitle
- Summary:
-
- int wtitle(win,str,val);
- int win; /* Window to Use */
- char *str; /* Title to Use */
- int val; /* Title Location */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: wprint()
-
- Description:
-
- This routine will place a string along the top border of the
- specified window in either the center, on the left, or on the
- right. To specify the location, val is 0, center, 1, left, or 2,
- right. The window's border attribute is used.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- wmessage()
-
- Example:
-
- wtitle(w,"[ Window 1 ]",1);
-
-
- wvline
- Summary:
-
- int wvline(wind,col);
- int wind; /* Window to Use */
- int col; /* Column for the Line */
-
- Created: 03/03/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source (C/A): C
-
- Located in: COUTPUT.OBJ
-
- Requires: cvline() putchci() gotoxy()
-
- Description:
-
- This function calls cvline() with the correct parameters to draw
- a vertical line in the specified window. The correct colors and
- border styles are used.
-
- Compiler Specifics:
-
- None.
-
- Return Value:
-
- Nothing.
-
- See Also:
-
- cvline() whline()
-
- Example:
-
- #include <color.h> /* Just for the colors... */
-
- int w;
-
- w = wopen(5,5,20,60,1); /* A box with a single line border */
-
- wvline(w,10); /* Draws a line down the box */
-
-
- CheckC
- Summary:
-
- Created: 12/25/85 Last Updated: 01/09/86
-
- Author: Bob Pritchett Source: C
-
- Syntax: CheckC <source> [<source>...]
-
- Documentation:
-
- CheckC
-
- A Small C Code Checker.
-
- Copyright 1985 Bob Pritchett
- New Dimension Software
-
- Version 1.3 - Documentation
-
- CheckC is a small C source checker I wrote to help me debug
- compiler errors. As you surely know, a missing or extra { } ( )
- [ ] " ' can throw off a compiler creating hundreds of errors, and
- not even giving a hint as to the problem. CheckC will go through
- your source file and make sure that all of your matchable
- characters are matched. It is smart enough to know when to count
- characters, knowing the escape codes and scanf/printf special
- characters.
- If at the end of the file all opening characters are not
- matched with a closing, or there is an unequal number of " ' you
- will be notified as to what the error is, and how many times it
- hapens.
- To use CheckC simply use the following command line:
-
- CHECKC <source> [<source>...]
-
- Where <source> is the file to check, followed by any number
- of additional files. CheckC will keep you informed of it's
- progress.
- Now this information is useful, and can often save lots of
- exasperating file searches, but on large files you spend a lot of
- time trying to locate the error yourself.
- The solution: Contact me.
- I have now in the debugging stages two more versions of the
- program that include the following options:
-
- /M - Create a 'Map' of the file. A map is a seperate report
- file that contains all of the matchable characters, set up so
- that looking at it will provide a visually obvious location of
- the problem. A map could look like:
-
- /* */
- ( )
- {
- ( ( [] ) )
-
-
- }
-
- In the example above there is a comment of unspecified
- length, followed by an open and close parenthisis, then an open
- bracket, and then a source line that could look like if ( x = (
- i + array[n] ) ) and then a closing bracket on the last line.
- This would indicate a perfectly fine source. (Note that comment
- markers go in a pair on one line, brackets always have their own
- lines, and everything else put on a single line until the number
- of open ( [ " ' is at zero. )
-
- /A - Analysis of source code. With this option an English
- analysis is placed in a separate reference file. This analysis
- is comprehensive in it's ability to distinguish beginnings and
- endings of code blocks ( {} ) and thus narrow down the area where
- the error could be. This also allows for multiple analysises
- that don't foul each other up, as at the end of each code block
- the counters are temporarily initialized. The only defect I have
- found so far is that like a compiler, you may get several errors
- for a single bug.
-
- Why are these still in production while I am releasing this
- version you may ask? Well, while other then making them look
- nice, I have to do extensive debugging, since error trapping
- tools really shouldn't have errors. I have not yet needed either
- of these bad enough to take the time to finish them myself. (As
- a matter of fact, while these may be almost done right now, they
- are in two seperate versions, and combining the two modified
- sources is going to be a bit of a job...) A ray of hope for
- those who would like these features. Simply contact me, tell me
- that you really like the program, and would like to have those
- features, and maybe some new one I haven't thought of. If you
- would like the source code, ask for it, and I may send it to you.
- (I don't know, I don't even know if anyone will use it...)
- Please include any comments, questions, or suggestions you have.
- (For example, it wouldn't be hard for me to add wildcards to the
- file names, but I don't need it yet, so it isn't there.)
- Once again, if you have any comment or whatever, please let
- me know.
-
-
- FLine
- Summary:
-
- Created: 03/02/86 Last Updated: 03/03/86
-
- Author: Bob Pritchett Source: C
-
- Syntax: FLine <source> <dest>
-
- Documentation:
-
- FLine
-
- A Structured Programming Utility
-
- Copyright 1986 Bob Pritchett
- New Dimension Software
-
- Version 1.1 - Documentation
-
- FLine is a programming tool that goes through source code
- and places all lines beginning with a non-whitespace character
- into the specified output file. This creates a useful reference
- file containing a list of all function declarations, including
- arguments, global variables, comments, and pre-processor
- directives. (This assumes, of course that you indent the actual
- code within your source file.)
- FLine is called as:
-
- FLine <source> <dest>
-
- Where <source> is the source code to process and <dest> is
- the name of the file to place the output in. Note that whatever
- is in <dest> is erased and replaced with FLine's output.
-
-
- COLOR.H
- Summary:
-
- Created: 04/14/86 Last Updated: 04/14/86
-
- Author: Bob Pritchett
-
- Description:
-
- This include file contains the define statements for all the
- color attributes possible in text. The colors are listed with a
- three letter name followed by a _ and F or B signifying fore or
- background attribute. To get a full attribute, add a fore and
- background color. (BLU_F+RED_B)
-
- Also included are definitions for BOLD (which is added to an
- attribute to intensify it), NORMAL (white on black), and several
- others. (NOTE: Some of the attriutes are for monochrome
- displays only, for example, UNDERLINE shows as blue on a color
- screen, and REVERSE as black on white.)
-
- For a list of all the colors and their abbreviations look at the
- header file.
-
-
- CSRDOS.H
- Summary:
-
- Created: 04/04/86 Last Updated: 04/04/86
-
- Author: Bob Pritchett and Alan Losoff
-
- Description:
-
- This header file contains structures and #define statements
- needed by functions accessing DOS 2.0 functions.
-
-
- CSRMISC.H
- Summary:
-
- Created: 04/20/86 Last Updated: 04/20/86
-
- Author: Bob Pritchett
-
- Description:
-
- This header file contains dummy() and the defintions for min()
- and max() macros which were ommitted from Microsoft's standard
- library.
-
-
- CSRTIME.H
- Summary:
-
- Created: 05/05/86 Last Updated: 04/20/86
-
- Author: Bob Pritchett
-
- This file contains two static char * arrays containing the names
- of the days of the week and the days of the month. The days of
- the week start with Sunday, the months start with a null and then
- January as the second entry, element one, to allow compatibility
- with the way DOS returns the date.
-
-
- ERRORS.H
- Summary:
-
- Created: 05/05/86 Last Updated: 05/05/86
-
- Author: Bob Pritchett (Data from Norton's Book.)
-
- This file contains a static char * array containing the DOS
- errors returned in AX after a DOS function call. These errors
- are for DOS 2.X alone, and do not apply to DOS 3.X extended error
- codes. Error descriptions start with element one.
-
-
- SKEY.H
- Summary:
-
- Created: 02/22/86 Last Updated: 02/22/86
-
- Author: Bob Pritchett (Data from Norton's Book.)
-
- Description:
-
- This header file contains #define statements for all of the
- special keys and combinations on the keyboard. These values are
- those returned as extened codes, after a null is read. They are
- in the basic format of KEY1KEY2, or simply Fx for function keys.
- (Note: Function keys are numbered through 40, 1-10 are normal
- keys, 11-20 are shift keys, 21-30 are ctrl keys, and 31-40 are
- alt keys. As in Shift-F2 returns F12.) C Spot Run - Documentation
-
-
- Appendix A - Updating the Library
-
- The C Spot Run routine library is constantly being added to
- as we receive contributions and write more routines ourselves.
- In the interest of saving time and space, library updates will
- come in one of two forms.
- First, small collections of new routines, or single
- routines, will be placed in archives along with a single page of
- documentation and distributed via BBSs. Registered users will
- receive information about new updates or a copy of those updates.
- When you receive an update archive you simply place the files
- into your library or linking directory and print out the
- documentation page, which is then inserted in alphabetical order
- into the library description section of this manual. (This is
- why those pages are not numbered and we recommend storing your
- manual in a three ring binder.)
- Second, major updates to the entire library will be
- distributed in archives containing all the routines, and a
- totally new version of the complete manual. These updates will
- be on new version numbers. C Spot Run - Documentation
-
-
- Appendix B - Contacting Authors
-
- Each description page mentions the name of the author of
- that routine, utility, or aid. If for some reason you would like
- to contact that author you may check the following directory for
- addresses and possibly phone numbers. (NOTE: All of the
- following authors voluntarily placed their addresses and
- sometimes their phone numbers in this directory. They have
- indicated a willingness to answer questions by doing this, but we
- ask you to be considerate and remember that some may be in a
- different time zone then the one you are calling from.)
-
- Gotthelf, Joe (609) 234-3347 - Data (300/1200B)
- 4 Overbrook Circle
- Moorestown, NJ 08057
-
- Mongelluzzo, Philip A. (203) 574-2326 - Voice
- 273 Windy Drive (203) 271-1579 - Data (300/1200B)
- Waterbury, CT 06705
-
- Pritchett, Bob (609) 424-2595 - Voice 4pm - 10pm
- 23 Pawtucket Drive (609) 354-9259 - Data (300/1200B)
- Cherry Hill, NJ 08003 FidoNet: 107/414 C Spot Run - Documentation
-
-
- Appendix C - Submitting Routines or Utilities
-
- All submissions to the routine library or utility collection
- should be made using the form on the following page, and should
- be sent to the address on that form. Please do not make
- additions to the library or utility collection on your own, this
- creates a problem and complicates the distribution.
- In addition to the following form please enclose a
- description of the routine or utility, preferably on an IBM PC
- disk. Please make this description in the appropriate format as
- specified in sections 4.1 and 4.2 of this manual.
-
-
- Routine/Utility Submission Form
-
-
- Name of Routine/Utility: ___________________________________
-
- Form(s) of Submission (C/ASM/OBJ/LIB/EXE/COM): _____________
-
-
- Are you releasing this routine/utility to the Pubic Domain
-
- or under another program? (PD/Program): ___________________
-
-
- If this release is under a voluntary contribution program,
-
- what is the suggested contribution? ($): ___________________
-
-
- May we put your address in the author directory? (Y/N): ____
-
- Your phone number? (Y/N): ____
-
- Your data address? (Y/N): ____
-
-
- Name: _________________________________
-
- Address: _________________________________
-
- City: _____________________ State: ____ ZIP: _________
-
- Phone: ( ) - Hours: ____________________
-
- Source ID: _______________ CompuServe ID: _________________
-
- Data #: ( ) - Hours: ____________________
-
- Fido Net: ____ /_____ Baud: ____________________
-
- In submitting this form you place your routine or utility
- into the C Spot Run C Add-on and Utility Library, and give
- permission for it's use as specified in Appendix C and
- sections one and two of this manual.
-
- Please send this form via US Mail to the following address,
- or via modem to the accompanying FidoNet address.
-
- Don't forget the description sheets, and of course the files
- you are submitting!
-
- C Spot Run
- New Dimension Software FidoNet 107/414
- 23 Pawtucket Drive Data: (609) 354-9259
- Cherry Hill, NJ 08003
-
-
- User Response Form
-
-
- We would like to hear from you, and would appreciate any
- comments, suggestions, and/or donations. Even if you are not
- making a donation or contributing to the library, we would
- appreciate some input, and it helps us to know if the library is
- serving it's intended purpose, and gives us some information on
- our users. Of course this is voluntary, but we hope you will
- take the time to fill out and mail this form.
-
- How did you obtain your copy of C Spot Run? ________________
-
- ____________________________________________________________
-
-
- What, in your opinion, are the most useful routines and
-
- utilities? _________________________________________________
-
-
- What do you think of the documentation? ____________________
-
- ____________________________________________________________
-
-
- Are you enclosing a contribution, and if so, how much and
-
- why? _______________________________________________________
-
-
- Do you have any comments and/or suggestions? _______________
-
- ____________________________________________________________
-
- ____________________________________________________________
-
-
- Would you like to be on a possible mailing list? (Y/N) ____
-
-
- Name: _________________________________
-
- Address: _________________________________
-
- City: _____________________ State: ____ ZIP: _________
-
- Phone: ( ) - Hours: ____________________
-
- Source ID: _______________ CompuServe ID: _________________
-
- Data #: ( ) - Hours: ____________________
-
- Fido Net: ____ /_____ Baud: ____________________
-
-
-
- Thank you, we hope you find the C Spot Run library of use.
-
- Please send this form via US Mail to the following address,
- or via modem to the accompanying FidoNet address.
-
-
- C Spot Run
- New Dimension Software FidoNet 107/414
- 23 Pawtucket Drive Data: (609) 354-9259
- Cherry Hill, NJ 08003
-
-
- Order Form
-
- NOTE: Users who receive source code may not redistribute
- it. The code is for your use only, and the right to redistribute
- is not included in the purchase. If two or more people will be
- using the source, rather then ordering just one copy please
- contact the author about a discount on several copies.
-
-
- ( ) I would like to register as a C Spot Run User, receive
-
- complete source code on disk, update notifications, and be placed
-
- on whatever mailing list may be formed. I am enclosing a $50
-
- donation.
-
-
- ( ) I would like to register as a C Spot Run User and
-
- receive all the benfits of such status with the exception of the
-
- source code. I am enclosing a $10 donation.
-
-
- Name: _________________________________
-
- Address: _________________________________
-
- City: _____________________ State: ____ ZIP: _________
-
- Phone: ( ) - Hours: ____________________
-
- Source ID: _______________ CompuServe ID: _________________
-
- Data #: ( ) - Hours: ____________________
-
- Fido Net: ____ /_____ Baud: ____________________
-
-
- C Spot Run
- New Dimension Software FidoNet 107/414
- 23 Pawtucket Drive Data: (609) 354-9259
- Cherry Hill, NJ 08003